Reflow drawn setting choices instead of clipping their labels - #79
Merged
Conversation
Toolbar / Position puts five drawn choices in one row. At the dialog's 560px minimum the content column is about 330px, so each segment holds roughly 52px inside its padding - less than the 44px "Bottom" needs once the border is taken out. A word too long for its line overflows and is clipped rather than wrapped, and TextTrimming does not help because it applies only when the height is constrained, so the label read as a different word: "Bottor right". The UniformGrid now recomputes its column count from its own width against the width at which a segment can hold that word. Five choices stay on one row at the default size and take a second row as the dialog narrows. Settings with two or three choices never reach the floor. The sample itself is wrapped in a down-only Viewbox, so it scales with the column rather than overflowing and losing its edges, and the segment template now honours HorizontalContentAlignment so the label is given the width it is being measured against. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The column count was settled from the width the row was measured against, which in this dialog arrives far narrower than the width the row is finally given. Five choices therefore sat on three columns in a row with room for all five, and stayed there: the count was computed once and nothing recomputed it as the dialog was resized. The row is now a plain panel that measures and arranges its own children, taking the count from the width it actually occupies in ArrangeOverride and measuring the children again when that disagrees with what MeasureOverride assumed. Five choices sit in one row when there is room, and fall to 4+1 and then 3+2 as the dialog narrows. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The drawn choices added in #73 — Pen button, Toolbar position, Toolbar layout —
were clipped when the Preferences dialog was narrowed. Toolbar / Position is the
one that showed it: five options in a row, and at the dialog's 560 px minimum
each segment holds about 52 px inside its padding, against the ~44 px "Bottom"
needs. A word too long for its line overflows and is clipped rather than wrapped,
and
TextTrimmingdoes not help because it applies only when the height isconstrained — so the label read as a different word, "Bottor right".
The row reflows
The choices now sit in a small panel that measures and arranges its own children,
taking its column count from the width the row actually occupies. Five choices
stay in one row when there is room and fall to 4+1 and then 3+2 as the dialog
narrows, rather than shrinking past legibility.
Two earlier attempts are worth recording, because both looked right and neither
was. Recomputing on
SizeChangedonly fires when the width changes, so the countsettled during the first layout pass stood for the life of the dialog. Moving it
to
MeasureOverridefixed the staleness but not the cause: the width a row ismeasured against arrives far narrower than the width it is finally given, so the
count was still computed against a width the row never had.
ArrangeOverridehasthe real width, and that is what it now reads.
The samples scale
Each sample is wrapped in a down-only
Viewbox, so it draws at its designed sizewhen there is room and shrinks with the column instead of overflowing and losing
its edges. The segment template honours
HorizontalContentAlignmentso the labelis given the width it is measured against, and the padding drops from
10,12to6,12.Version 1.1.4. Release build clean with
TreatWarningsAsErrors, smoke tests pass.🤖 Generated with Claude Code